# -*- coding: utf-8 -*-
# 姓名:谚语
# 开发时间:2022/10/27 9:29
from comment.utils.Serializers import BaseListSerializer


class BankCardListSerializer(BaseListSerializer):
    """
    银行卡列表数据 序列化的类
    """

    def to_dict(self):
        lst = []
        for card in self.data_list:
            lst.append(
                {
                    'cardId': card.bankInfoId,  # 银行卡的主键
                    'cardNum': card.bankCardNum,  # 银行卡卡号
                    'bankName': card.openingBank  # 银行卡开户银行
                }
            )
        return lst
